﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>Ping: com.stateforge.statemachine.examples.ping.EchoServer Class Reference</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                Examples using state machines generated by StateBuilderJava
            </h1>
            <h3>
                Ping: com.stateforge.statemachine.examples.ping.EchoServer Class Reference
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespacecom.html">com</a>      </li>
      <li class="navelem"><a class="el" href="namespacecom_1_1stateforge.html">stateforge</a>      </li>
      <li class="navelem"><a class="el" href="namespacecom_1_1stateforge_1_1statemachine.html">statemachine</a>      </li>
      <li class="navelem"><a class="el" href="namespacecom_1_1stateforge_1_1statemachine_1_1examples.html">examples</a>      </li>
      <li class="navelem"><a class="el" href="namespacecom_1_1stateforge_1_1statemachine_1_1examples_1_1ping.html">ping</a>      </li>
      <li class="navelem"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html">EchoServer</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">com.stateforge.statemachine.examples.ping.EchoServer Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="com::stateforge::statemachine::examples::ping::EchoServer" -->
<p><a href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#a1b42a3af2b6c7018ae426fb09ffe5bee">EchoServer</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#a0f733b49b2e53f45cec163d2f682925e">start</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#af5a8d7350c88b21212ba56d09e05e1c9">stop</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ServerBootstrap&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#a24dec103106349a2fcf2653b7fc3d7d6">bootstrap</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#a5c2ebdcec61b59e08bca7fa9e8fa6588">port</a> = 2011</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="_echo_server_8java_source.html#l00012">12</a> of file <a class="el" href="_echo_server_8java_source.html">EchoServer.java</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a1b42a3af2b6c7018ae426fb09ffe5bee"></a><!-- doxytag: member="com::stateforge::statemachine::examples::ping::EchoServer::EchoServer" ref="a1b42a3af2b6c7018ae426fb09ffe5bee" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">com.stateforge.statemachine.examples.ping.EchoServer.EchoServer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_echo_server_8java_source.html#l00017">17</a> of file <a class="el" href="_echo_server_8java_source.html">EchoServer.java</a>.</p>
<div class="fragment"><pre class="fragment">                       {
        <span class="comment">// Configure the server.</span>
        this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#a24dec103106349a2fcf2653b7fc3d7d6">bootstrap</a> = <span class="keyword">new</span> ServerBootstrap(
                <span class="keyword">new</span> NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool()));

        <span class="comment">// Set up the pipeline factory.</span>
        this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#a24dec103106349a2fcf2653b7fc3d7d6">bootstrap</a>.setPipelineFactory(<span class="keyword">new</span> ChannelPipelineFactory() {
            <span class="keyword">public</span> ChannelPipeline getPipeline() throws Exception {
                <span class="keywordflow">return</span> Channels.pipeline(<span class="keyword">new</span> EchoServerHandler());
            }
        });  
    }
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a0f733b49b2e53f45cec163d2f682925e"></a><!-- doxytag: member="com::stateforge::statemachine::examples::ping::EchoServer::start" ref="a0f733b49b2e53f45cec163d2f682925e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void com.stateforge.statemachine.examples.ping.EchoServer.start </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_echo_server_8java_source.html#l00032">32</a> of file <a class="el" href="_echo_server_8java_source.html">EchoServer.java</a>.</p>
<div class="fragment"><pre class="fragment">                       {
        <span class="comment">// Bind and start to accept incoming connections.</span>
        this.<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#a24dec103106349a2fcf2653b7fc3d7d6">bootstrap</a>.bind(<span class="keyword">new</span> InetSocketAddress(<a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#a5c2ebdcec61b59e08bca7fa9e8fa6588">port</a>));  
    }
</pre></div>
</div>
</div>
<a class="anchor" id="af5a8d7350c88b21212ba56d09e05e1c9"></a><!-- doxytag: member="com::stateforge::statemachine::examples::ping::EchoServer::stop" ref="af5a8d7350c88b21212ba56d09e05e1c9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void com.stateforge.statemachine.examples.ping.EchoServer.stop </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_echo_server_8java_source.html#l00037">37</a> of file <a class="el" href="_echo_server_8java_source.html">EchoServer.java</a>.</p>
<div class="fragment"><pre class="fragment">                      {
        <span class="comment">//TODO it hangs herer and eat 100% CPU</span>
        <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#a24dec103106349a2fcf2653b7fc3d7d6">bootstrap</a>.releaseExternalResources();
    }
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a24dec103106349a2fcf2653b7fc3d7d6"></a><!-- doxytag: member="com::stateforge::statemachine::examples::ping::EchoServer::bootstrap" ref="a24dec103106349a2fcf2653b7fc3d7d6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ServerBootstrap <a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#a24dec103106349a2fcf2653b7fc3d7d6">com.stateforge.statemachine.examples.ping.EchoServer.bootstrap</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_echo_server_8java_source.html#l00014">14</a> of file <a class="el" href="_echo_server_8java_source.html">EchoServer.java</a>.</p>

</div>
</div>
<a class="anchor" id="a5c2ebdcec61b59e08bca7fa9e8fa6588"></a><!-- doxytag: member="com::stateforge::statemachine::examples::ping::EchoServer::port" ref="a5c2ebdcec61b59e08bca7fa9e8fa6588" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server.html#a5c2ebdcec61b59e08bca7fa9e8fa6588">com.stateforge.statemachine.examples.ping.EchoServer.port</a> = 2011<code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_echo_server_8java_source.html#l00015">15</a> of file <a class="el" href="_echo_server_8java_source.html">EchoServer.java</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/main/java/com/stateforge/statemachine/examples/ping/<a class="el" href="_echo_server_8java_source.html">EchoServer.java</a></li>
</ul>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
